var layer,
    form,
    table,
    $;

var user = JSON.parse(localStorage.getItem('user'));
layui.use(['jquery', 'layer', 'form', 'table'], function () {
    layer = layui.layer,
        table = layui.table,
        form = layui.form,
        $ = layui.jquery;

    $.ajax({
        url:'/Product/getAllProductCategroy',
        async: false,
        dataType: 'json',
        success: function (item) {
            item.data.forEach(function(ele, index){
                $('#proTitle').append(new Option(ele.title, ele.categroyId));// 下拉菜单里添加元素
            });
            form.render("select");
        }
    })
});

function search() {
    var data = form.val("formTest");
    parent.getTableData(data.selProTitle, '', data.name, data.label, data.selStat, data.productCode, data.price);
    var index = parent.layer.index;
    parent.layer.close(index);
}